from appium import webdriver
import time


desired_caps={}
desired_caps['platformName']='Android'
desired_caps['version']='8.0.0'
desired_caps['deviceName']='VPL6R18A29002470'#这是测试机的型号，可以查看手机的关于本机选项获得
# desired_caps['version']='7.1.1'
# desired_caps['deviceName']='HGAFQ94U'#这是测试机的型号，可以查看手机的关于本机选项获得
# desired_caps['version']='8.1.0'
# desired_caps['deviceName']='9435cb1'#这是测试机的型号，可以查看手机的关于本机选项获得
# desired_caps['version']='7.1.0'
# desired_caps['deviceName']='127.0.0.1:21503'#这是测试机的型号，可以查看手机的关于本机选项获得
# #模拟器
# desired_caps['version']='7.1.2'
# desired_caps['deviceName']='emulator-5554'#这是测试机的型号， 可以查看手机的关于本机选项获得

desired_caps['unicodeKeyboard'] = 'true' # 使用unicode编码方式发送字符串
desired_caps['resetKeyboard'] = 'true'   # 隐藏键盘
# desired_caps['app'] = PATH('D:\\qq.apk')#被测试的App在电脑上的位置
desired_caps['recreateChromeDriverSessions'] = 'True'
desired_caps['appPackage'] = 'cn.com.fwd.iscan'
desired_caps['appActivity'] = 'cn.com.fwd.iscan.activity.SplashActivity'
# desired_caps['chromedriverExecutableDir'] = r'D:\workspace\webdriver\chrome\2.18'


driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps)
time.sleep(2)